Skip to content

Add environment-first new task flow on mobile - #4447

Open
colonelpanic8 wants to merge 6 commits into
pingdotgg:mainfrom
colonelpanic8:feat/mobile-environment-first-new-thread
Open

Add environment-first new task flow on mobile#4447
colonelpanic8 wants to merge 6 commits into
pingdotgg:mainfrom
colonelpanic8:feat/mobile-environment-first-new-thread

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 24, 2026

Copy link
Copy Markdown

What Changed

  • Split the mobile new-task picker into environment and project stages.
  • Scope logical project grouping to the selected environment so a newer project on another machine cannot replace the intended target.
  • Preserve incoming-share continuation and add project flows across the new navigation stage.
  • Add focused picker tests for environment scoping, project counts, and empty environments.

Why

This brings the mobile new-task flow in line with #4426: users explicitly choose where a task will run before choosing the project.

UI Changes

All shots: Android emulator (Pixel 6, API 35), light theme, same device and seeded environments for every image.

Environment-first new task flow (new behavior)

Step 1 — choose the environment:

Choose an environment

Step 2 — choose a project, scoped to that environment:

Choose a project

Empty-state call to action when the selected environment is not ready

Same state in both images: an environment was already chosen from step 1, and its project list has not arrived yet.

Before — the picker offered "Add environment", pushing the user toward creating another connection instead of working with the one they had just selected:

Before: Add environment call to action while the selected environment is still connecting

After — no call to action while the selected environment is loading or unavailable; the back chevron to the environment picker is still the escape hatch:

After: no call to action while the selected environment is still connecting

Verification

  • vp test run apps/mobile/src/features/threads/newTaskPicker.test.ts (2 tests)
  • vp run --filter @t3tools/mobile typecheck
  • vp run lint:mobile (native linters unavailable on Linux; generated native projects skipped)
  • vp check (zero errors; existing web warnings only)
  • vp run typecheck
  • Android emulator: verified environment → scoped project navigation across two connected environments, plus back navigation between stages.
  • Android emulator (Pixel 6, API 35, Expo dev client from this branch): re-verified the environment → scoped project navigation and captured the before/after empty-state call to action above.

Note

Medium Risk
Touches core new-task navigation, incoming-share resume paths, and environment-scoped project selection; regressions could mis-route shares or show wrong projects, but logic is largely extracted and covered by focused tests.

Overview
Adds an environment-first step to the mobile new-task sheet: NewTaskEnvironmentRouteScreen is now the initial route, and the existing project picker becomes NewTaskProject with a required environmentId.

Project choices are scoped to the selected environment via buildNewTaskProjectItems / buildNewTaskEnvironmentItems in newTaskPicker.ts, so cross-machine repo grouping cannot pick the wrong target. Empty and loading states use per-environment shell state (useEnvironmentShellState) and no longer suggest “Add environment” while a chosen environment is still connecting.

Navigation and share flows are updated: draft back-navigation returns to NewTaskProject when an environment was known; add-project can receive environmentId to preselect the environment. Unit tests cover scoping, counts, and empty-state actions.

Reviewed by Cursor Bugbot for commit 49d2d83. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add environment-first new task flow on mobile

  • Adds a new NewTaskEnvironmentRouteScreen as the first step in the new-task flow, letting users pick an environment before seeing projects. The project picker (NewTaskRouteScreen) is now scoped to a selected environmentId.
  • Introduces buildNewTaskEnvironmentItems and buildNewTaskProjectItems in newTaskPicker.ts to filter environments (those with at least one project) and projects (scoped to a given environment).
  • Adds deriveNewTaskProjectPickerEmptyState and deriveNewTaskProjectPickerAction to show environment-specific loading/error states and conditionally render add-project or add-environment actions.
  • Updates NewTaskDraftScreen to navigate back to the environment-aware project picker (NewTaskProject) when an environment was initially specified, or to the environment picker otherwise.
  • AddProjectSourceScreen and its route now accept an optional environmentId to preselect an environment when adding a project.

Macroscope summarized 49d2d83.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d5a563ea-928b-43f8-ae1d-bd23c0fa2434

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Jul 24, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/mobile-environment-first-new-thread branch from 2d96724 to 355a74a Compare July 24, 2026 11:27
Comment thread apps/mobile/src/features/threads/NewTaskRouteScreen.tsx Outdated
Comment thread apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
Comment thread apps/mobile/src/features/threads/NewTaskRouteScreen.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing workflow for creating tasks on mobile, adding an environment selection step as the first screen. New features that change navigation flows and add substantial new components warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@colonelpanic8
colonelpanic8 force-pushed the feat/mobile-environment-first-new-thread branch from 355a74a to 06d4dbd Compare July 24, 2026 17:00
Comment thread apps/mobile/src/Stack.tsx
Comment thread apps/mobile/src/features/threads/newTaskPicker.ts
Comment thread apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
@colonelpanic8
colonelpanic8 force-pushed the feat/mobile-environment-first-new-thread branch from 61fee70 to 0bad292 Compare July 25, 2026 02:19
Comment thread apps/mobile/src/features/threads/newTaskPicker.ts
Comment thread apps/mobile/src/features/threads/NewTaskDraftScreen.tsx Outdated
Comment thread apps/mobile/src/features/threads/NewTaskEnvironmentRouteScreen.tsx Outdated
@colonelpanic8
colonelpanic8 force-pushed the feat/mobile-environment-first-new-thread branch from 0bad292 to 7013878 Compare July 25, 2026 03:54
Comment thread apps/mobile/src/features/threads/newTaskPicker.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/mobile-environment-first-new-thread branch from 7013878 to e3415f0 Compare July 27, 2026 11:14
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 28, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/mobile-environment-first-new-thread branch from e3415f0 to 5651c88 Compare July 28, 2026 02:07

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5651c88. Configure here.

Comment thread apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
Comment thread apps/mobile/src/features/threads/NewTaskEnvironmentRouteScreen.tsx
colonelpanic8 and others added 6 commits July 27, 2026 19:47
An environment connection can stay `connected` while its shell
subscription fails, which left the project picker rendering a spinner
and "Loading projects" with no way to learn why projects never arrive.
Report the shell error before falling through to the loading state, and
keep cached snapshots on the existing empty-catalog message.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…icked

The project picker showed the "Add environment" call to action whenever
the chosen environment was not connected with a shell snapshot, so a
still-loading or unreachable environment pushed users toward creating a
new connection instead of working with the one they just selected.
Derive the empty state action explicitly: no action while loading or
while the selected environment is unavailable, "Add environment" only
when no environment is selected, and "Add new project" once the
selected environment is ready.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@colonelpanic8
colonelpanic8 force-pushed the feat/mobile-environment-first-new-thread branch from 5f74802 to 49d2d83 Compare July 28, 2026 02:51
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant